package com.xindacloud.sms.console.system.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.result.ResultGenerator;
import com.xindacloud.sms.console.system.dto.SmsSubmissionRecordDTO;
import com.xindacloud.sms.console.system.entity.SmsSubmissionRecord;
import com.xindacloud.sms.console.system.mapper.SmsSubmissionRecordMapper;
import com.xindacloud.sms.console.system.service.ISmsSubmissionRecordService;

/**
 * <p>
 * 短信发送记录 服务实现类
 * </p>
 *
 * @author czc
 * @since 2019-10-15
 */
@Service
public class SmsSubmissionRecordServiceImpl extends ServiceImpl<SmsSubmissionRecordMapper, SmsSubmissionRecord> implements ISmsSubmissionRecordService {

	@Override
	public Result getSmsSubmissionRecordList(SmsSubmissionRecordDTO smsSubmissionRecordDTO) {
		IPage<SmsSubmissionRecord> page=new Page<>(smsSubmissionRecordDTO.getPageNum(),smsSubmissionRecordDTO.getPageSize());
		QueryWrapper<SmsSubmissionRecord> queryWrapper=new QueryWrapper<>();
		/*if(smsSubmissionRecordDTO.getFromTime()!=null) {
		    queryWrapper.ge("send_time", smsSubmissionRecordDTO.getFromTime());
		}
		if(smsSubmissionRecordDTO.getToTime()!=null) {
			queryWrapper.le("send_time", smsSubmissionRecordDTO.getToTime());
			}*/
		return ResultGenerator.genSuccessResult(this.page(page,queryWrapper));
	}

}
